<template>
  <div class="collect">
      <top col="我的收藏" />
      <collectModule 
        v-for="item in collectdata" :key="item.length"
        :coll='item'
      />
      <button @click="fnn(12)">测试收藏</button>
  </div>
</template>

<script>
import top from '@/components/module/top'
import collectModule from '@/components/module/colloectModule'
export default {
    components:{
        collectModule,
        top,   //头部组件
    },
    data(){
        return{
            txt:'',
            span:'',
            coll:'',
            collectdata:{}
        }
    },
    created(){
        this.$axios({
            url:'/user_star',
            method:'get',
        }).then(res=>{
            console.log(res);
            this.collectdata = res.data.data
            console.log(this.collectdata);
        })
    },
    methods:{
        fnn(id){  //使用收藏接口
            this.$axios({
                url:'/post_star/'+id
            }).then(res=>{
                console.log(res)
            })
        }
    }
}
</script>

<style lang="less" scoped>

</style>